home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / mhis020.zip / CALLSTAT.MH < prev    next >
Text File  |  1996-12-21  |  2KB  |  61 lines

  1. #ifndef __CALLSTAT_MH
  2. #define __CALLSTAT_MH
  3.  
  4. #ifndef __CALLINFO_MH
  5. #include "callinfo.mh"
  6. #endif
  7.  
  8. #ifndef __CALLCRIT_MH
  9. #include "callcrit.mh"
  10. #endif
  11.  
  12. #ifndef __DATE_MH
  13. #include "date.mh"
  14. #endif
  15.  
  16. #ifndef __FLOAT_MH
  17. #include "float.mh"
  18. #endif
  19.  
  20. struct _callstats {
  21.   unsigned int:         calls;
  22.   unsigned long:        time;
  23.   unsigned int:         filesup;
  24.   unsigned int:         filesdn;
  25.   unsigned int:         read;
  26.   unsigned int:         posted;
  27.   unsigned long:        kbup;
  28.   unsigned long:        kbdn;
  29.   unsigned int:         paged;
  30.   unsigned int:         days;
  31.   };
  32.  
  33. void stats_add (Ref struct _callstats: stats, Ref struct _callinfo: ci) {
  34.   stats.calls           := stats.calls          + 1;
  35.   stats.kbup            := stats.kbup           + ci.kbup;
  36.   stats.kbdn            := stats.kbdn           + ci.kbdn;
  37.   stats.filesup         := stats.filesup        + ci.filesup;
  38.   stats.filesdn         := stats.filesdn        + ci.filesdn;
  39.   stats.read            := stats.read           + ci.read;
  40.   stats.posted          := stats.posted         + ci.posted;
  41.   stats.paged           := stats.paged          + ci.paged;
  42.   stats.time            := stats.time           + time_online (ci);
  43.   }
  44.  
  45. void stats_clear (Ref struct _callstats: stats) {
  46.   stats.calls           := 0;
  47.   stats.kbup            := 0;
  48.   stats.kbdn            := 0;
  49.   stats.filesup         := 0;
  50.   stats.filesdn         := 0;
  51.   stats.read            := 0;
  52.   stats.posted          := 0;
  53.   stats.paged           := 0;
  54.   stats.time            := 0;
  55.   stats.days            := 0;
  56.   }
  57.  
  58.  
  59.  
  60. #endif
  61.